<header>
    <title>用户{notempty name="admin"}修改{else /}添加{/notempty}</title>
</header>
{include file="public/header" /}
        <!-- 内容主体区域 -->
        <br />
        <div style="padding: 15px;">

            <form class="layui-form" action="" method="post">
                {notempty name="admin"}<input type="hidden" name="id" value="{$admin.id}">{/notempty}
                <div class="layui-form-item">
                    <label class="layui-form-label">用户名：</label>
                    <div class="layui-input-block">
                        <input type="text" style="width: 200px;" name="admin_name" {notempty name="admin"}value="{$admin.admin_name}"{/notempty} required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">密码框</label>
                    <div class="layui-input-inline">
                        <input type="password" style="width: 200px;" name="admin_pwd" {notempty name="admin"}value="{$admin.admin_pwd}"{/notempty} required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
                    </div>
                </div>
<!--                写到角色修改-->

                <div class="layui-form-item">
                    <label class="layui-form-label">角色：</label>
                    <div class="layui-input-block">
                        {foreach $list as $key=>$vo }
                        <input type="checkbox" name="role_id[{$vo.id}]"  {notempty name="role"}{if in_array($vo.id,$role)}checked{/if}{/notempty} title="{$vo.role_name}" value="{$vo.id}">
                        {/foreach}
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="0" title="启用" checked>
                        <input type="radio" name="status" value="1" title="未启用">
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>

            <script>
                //Demo
                layui.use('form', function(){
                    var form = layui.form;

                    //监听提交
                    /*form.on('submit(formDemo)', function(data){
                        layer.msg(JSON.stringify(data.field));
                        return false;
                    });*/
                });
            </script>
            {include file="public/footer" /}
